Xi Demos:
    Simple 2 dim. Plots | Velocity Fields | Surface |Trajektories

    Simple 2 dim. Plots

    - generating simple Plots -

    Code for this example:

    (  1)>set_seed(1234)
    (  2)>r=randomn(10000);
    (  3)>[h,x]=histogram(r,\binsize=0.2);
    (  4)>plot(r,\xtitle="Event number",\ytitle="Signal");
    (  5)>
    (  6)>/* now shrink and move the plot with the mouse */
    (  7)>
    (  8)>h=h/double(total(h));
    (  9)>plot(x,h,\hist,\xrange={-5,3},\yrange={0,0.1},\num=1);
    ( 10)>plot(\xtitle="Signal",\ytitle="Density");
    ( 11)>
    ( 12)>/* fit a gauss function to the histogram */
    ( 13)>
    ( 14)>p=fit([(x;a,mu,sigma)->y :y=a*exp(-0.5*pow((x-mu)/sigma,2));],{2,2,2},x,h);
    Message: sum of squares convergence
    ( 15)>f=p[0]*exp(-0.5*pow((x-p[1])/p[2],2));
    ( 16)>plot(x,f,\curve,\linestyle={5,5});
    

    Rechts Index © 1995 by Bodo Junglas, Klaus Spanderen and Fabian Weis
    - Last revised: April 23 1996